using Dapr.AppCallback.Autogen.Grpc.v1;
using Dapr.Client.Autogen.Grpc.v1;
using Dcy.Dapr.RemoteServices;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;

namespace Dcy.Dapr.Server.GrpcServices;

public class UserInfoRemoteService : AppCallback.AppCallbackBase
{
    public override async Task<InvokeResponse> OnInvoke(InvokeRequest request, ServerCallContext context)
    {
        var response = new InvokeResponse();
        switch (request.Method)
        {
            case "Login":
                var input = request.Data.Unpack<LoginRemoteInDto>();
                response.Data = Any.Pack(new LoginRemoteOutDto { Data = "Ok Login" });
                break;
            default:
                break;
        }

        return response;
    }

}